<div ng-controller="OrderCtrl" ng-init="infoAction()" class="sui-form form-horizontal">
    <ul class="sui-breadcrumb">
        <li>
            <a href="#/order/list">{{ "Order" | translate }}</a>
        </li>
        <li class="active">{{ "info" | translate }}</li>
    </ul>
    <member-chat ng-model="order.member_id"></member-chat>
    <div class="control-group">
        <label class="control-label v-top">{{ "store" | translate }}：</label>
        <div class="controls">
            <store-list ng-model="order.store_id" stype="1"></store-list>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top">{{ "顾客" | translate }}：</label>
        <div class="controls">
            <wxinfo ng-model="order.member_id" stye="1"></wxinfo>
<!--            <div>-->
<!--                <send-mb-msg title="'发送消息'" user-id="order.member_id" seller="1" app_id="wxappid" chosed-type="'template'" page="'/pages/index/index?cmd=lianxikefu&show=y&msg=[msg]'"></send-mb-msg>-->
<!--            </div>-->
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top"> {{ "Orderid" | translate }}：</label>
        <div class="controls">
            <div>
                <button class="btn" ngclipboard data-clipboard-text="{{order.order_id}}" ngclipboard-success="onSuccess(e,this);">
                    {{order.order_id}}
                </button>
            </div>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top">
            {{ "总应付金额" | translate }}：</label>
        <div class="controls">
            {{order.fuhao}} {{ order.total_fee }}
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top"> {{ "包装费" | translate }}：</label>
        <div class="controls">
            {{order.fuhao}} {{ order.packing_fee }}
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top"> {{ "运费" | translate }}：</label>
        <div class="controls">
            {{order.fuhao}} {{ order.post_fee }}
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top"> {{ "税费" | translate }}：</label>
        <div class="controls">
            {{order.fuhao}} {{ order.total_tax }}
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top">
            {{ "总优惠减免金额" | translate }}：</label>
        <div class="controls">
            {{order.fuhao}} {{ order.discount_fee + order.mjs_discount_fee }}
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top"> {{ "总实付金额" | translate }}：</label>
        <div class="controls">
            {{order.fuhao}} {{ order.payment }}
        </div>
    </div>
    <div class="control-group" ng-show=" order.paid_time.search('0001-01-01') ==-1">
        <label class="control-label v-top"> {{ "支付时间" | translate }}：</label>
        <div class="controls">
            {{ order.paid_time | ddtt }}
        </div>
    </div>
    <div class="control-group" ng-if="order.receiver_time.search('0001-01-01') ==-1">
        <label class="control-label v-top">
            {{ !order.deliver_name ? "自提时间" : "配送时间" }}：</label>
        <div class="controls">{{ order.receiver_time | ddtt }}</div>
    </div>
    <div class="control-group" ng-show="order.deliver_name">
        <label class="control-label v-top">
            {{ "收货人姓名" | translate }}：</label>
        <div class="controls">
            {{ order.deliver_name }}
        </div>
    </div>

    <div class="control-group" ng-show="order.deliver_phone">
        <label class="control-label v-top">
            {{ "deliver_phone" | translate }}：</label>
        <div class="controls">
            {{ order.deliver_phone }}
        </div>
    </div>

    <div class="control-group" ng-show="order.deliver_phone">
        <label class="control-label v-top">
            {{ "deliver_address" | translate }}：</label>
        <div class="controls">
            {{ order.province }} {{ order.city }} {{ order.district }} {{ order.deliver_address }}
            <!-- <myarea ng-model="express" backcall="saveupdate(data)" up="1" ></myarea> -->
        </div>
    </div>
    <div class="control-group" ng-show="order.status == 'S_ORDER_WAIT_DELIVERY' || order.status == 'S_ORDER_WAIT_CONFIRM'">
        <label class="control-label v-top"></label>
        <div class="controls">
            <!-- 不等于待发货 之前的状态才能修改 -->
            <order-deliver-address ng-model="order.order_id" order="" backcall="saveupdate(data)"></order-deliver-address>
        </div>
    </div>
    <div class="control-group" ng-if="order.note">
        <label class="control-label v-top"> {{ "留言" | translate }}：</label>
        <div class="controls">
            {{ order.note }}
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top"> {{ "备注" | translate }}：</label>
        <div class="controls">
            <textarea rows="6" ng-model="order.remark" class="input-xlarge"></textarea>
            <br />
            <button ng-click="saveupdate(order)" class="sui-btn btn-success">修改备注</button>
        </div>
    </div>
    <div class="control-group" ng-show="order.shipping_code">
        <label class="control-label v-top"> {{ "Expressid" | translate }}：</label>
        <div class="controls">
            {{ order.shipping_code }}
            <a ng-show="order.status == 'S_ORDER_WAIT_RECEIVE'&&order.shipping_code " href="#/order/delivery?order_id={{ order.order_id }}" class="sui-btn btn-success">物流修改</a>
        </div>
        <div class="controls" ng-show="order.shipping_corp == 'ZTO'">
            <button class="btn" ng-click="getdtb(order.order_id)">获取大头笔</button> {{ datoubi }}
        </div>
    </div>
    <div class="control-group" ng-show="order.shipping_corp">
        <label class="control-label v-top">
            {{ "express_corp" | translate }}：</label>
        <div class="controls">
            <carryway-type ng-model="order.shipping_corp" stype="1" ng-show="order.shipping_corp"></carryway-type>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top"> {{'订单状态'| translate}}：</label>
        <div class="controls" ng-if="order.status">
            <div class="sui-msg msg-tips">
                <div class="msg-con">
                    <order-status ng-model="order.status" stype="1"></order-status>
                </div>
                <s class="msg-icon"></s>
            </div>
            <div ng-show=" order.status =='S_ORDER_WAIT_PAYMENT' ">
                <button ng-click="orderCancelUpdate(order.order_id,$event)" class="sui-btn btn-success">订单关闭</button>
            </div>
        </div>
    </div>
    <div class="control-group" ng-show="order.status !=='S_ORDER_WAIT_PAYMENT' &&  order.status !=='S_ORDER_COMPLETED' &&  order.status !=='S_ORDER_CANCEL' && order.status !=='S_ORDER_AFTER_SERVICE' && order.status !=='S_ORDER_ALREADY_REFUNDED' ">
        <!-- ng-show="order.status =='S_ORDER_WAIT_RECEIVE' &&  order.status !=='S_ORDER_WAIT_DELIVERY' ||  order.status !=='S_ORDER_WAIT_RECEIVE' &&  order.status !=='S_ORDER_WAIT_RATE' " -->
        <label class="control-label v-top"> {{ "售后" | translate }}：</label>
        <div class="controls">
            <button ng-click="service($event)" class="sui-btn btn-success">
                申请售后
            </button>
            <span ng-if="order.pickpoint_id">
                <order-refund order-id="order.order_id" pickpoint-id="order.pickpoint_id"></order-refund>
            </span>
        </div>
    </div>
    <div class="control-group" ng-if="order.status =='S_ORDER_AFTER_SERVICE'">
        <label class="control-label v-top"> {{ "退款" | translate }}：</label>
        <div class="controls">
            <button ng-click="refund($event,order.payment)" class="sui-btn btn-success">
                退款
            </button>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label v-top"> {{ "Item" | translate }}：</label>
        <div class="controls">
            <table class="sui-table table-bordered" ng-show="order.items[0]" style="margin-bottom: 5px;">
                <thead>
                    <tr>
                        <th>{{ "主图" | translate }}</th>
                        <th>{{ "title" | translate }}</th>
                        <th>{{ "num" | translate }}</th>
                        <th>{{ "包装费" | translate }}</th>
                        <th>{{ "税费" | translate }}</th>
                        <th>{{ "total_payment" | translate }}</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="sku in order.items">
                        <td>
                            <img ng-src="{{ sku.image }}" width="120" />
                        </td>
                        <td>
                            {{ sku.title }}
                            <br />
                            <b>
                                {{ sku.sku_properties | skuname }}
                            </b>
                            <div>外部编码：{{ sku.sku_outer_id }}</div>
                        </td>
                        <td>
                            {{ sku.quantity }}
                        </td>
                        <td>{{ sku.packing_fee }}</td>
                        <td>{{ sku.true_taxes_fee | number:1 }}</td>
                        <td>
                            {{ sku.payment }}<br/>
                            <div ng-if="sku.activitys">{{sku.activitys.name}}<span ng-if=sku.discount_fee>：优惠{{order.fuhao}}{{sku.discount_fee}}</span></div>
                            <div ng-if="sku.pintuan_data">{{sku.pintuan_data.name}}<span ng-if=sku.discount_fee>：优惠{{order.fuhao}}{{sku.discount_fee}}</span></div>
                            <div ng-if="sku.bargain_act_id">砍价活动<span ng-if=sku.discount_fee>：优惠{{order.fuhao}}{{sku.discount_fee}}</span></div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <!-- <div class="control-group">
        <label class="control-label v-top"> {{ "评价" | translate }}：</label>
        <div class="controls">
            <table class="sui-table table-bordered" ng-show="order.items[0]" style="margin-bottom: 5px;">
                <thead>
                    <tr>
                        <th>{{ "主图" | translate }}</th>
                        <th>{{ "title" | translate }}</th>
                        <th>{{ "num" | translate }}</th>
                        <th>{{ "包装费" | translate }}</th>
                        <th>{{ "税费" | translate }}</th>
                        <th>{{ "total_payment" | translate }}</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="sku in order.items">
                        <td>
                            <img ng-src="{{ sku.image }}" width="120" />
                        </td>
                        <td>
                            {{ sku.title }}
                            <br />
                            <b>
                                    {{ sku.sku_properties | skuname }}
                                </b>
                            <div>外部编码：{{ sku.sku_outer_id }}</div>
                        </td>
                        <td>
                            {{ sku.quantity }}
                        </td>
                        <td>{{ sku.packing_fee }}</td>
                        <td>{{ sku.item_tax }}</td>
                        <td>
                            {{ sku.payment }}
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div> -->
    <div class="control-group">
        <label class="control-label v-top">自定义表单：</label>
        <div class="controls">
            <form name="Tradeform" class="sui-form form-horizontal" novalidate ng-show="form_options">
                <div ng-repeat="(key, value) in form_options">
                    <div class="control-group">
                        <label class="control-label v-top">{{value.title|translate}}</label>
                        <div class="controls">
                            <div ng-if="value.type == 'image'">
                                <ul class="unstyled">
                                    <li>
                                        <label><img ng-src="{{form_data1[value.type_id].option}}"
                                                style="width:100px;height: 100px"></label>
                                    </li>
                                    <li>
                                        <label>
                                            <br /> 链接：
                                            <input ng-model="form_data1[value.type_id].option" type="text" name="name"
                                                style="width:100px">
                                            <attachment owner-id="value.type_id" owner-type="item"
                                                dhf-ng-model="form_data1[value.type_id].option" xtype="url" mult="false"
                                                title="Upload" use-type="png,jpeg,gif,jpg,JPG"></attachment>
                                        </label>
                                    </li>
                                </ul>
                            </div>
                            <div ng-if="value.type != 'image'">
                                <div ng-if="value.type == 'textarea'">
                                    <textarea rows="3" ng-model="form_data1[value.type_id].option" class="input-xlarge ng-pristine ng-valid ng-empty ng-touched" style=""></textarea>
                                </div>
                                <div ng-if="value.type == 'number'">
                                    <input class="input-large" type="text" ng-model="form_data1[value.type_id].option" />
                                </div>
                                <div ng-if="value.type == 'idcard'">
                                    <input class="input-large" type="text" ng-model="form_data1[value.type_id].option" />
                                </div>
                                <div ng-if="value.type == 'digit'">
                                    <input class="input-large" type="text" ng-model="form_data1[value.type_id].option" />
                                </div>
                                <div ng-if="value.type == 'text' || value.type == 'mobile'">
                                    <input class="input-large" type="text" ng-model="form_data1[value.type_id].option" />
                                </div>
                                <div ng-if="value.type == 'date'">
                                    <input id="start_time" ng-model="form_data1[value.type_id].option" datetimepicker name="start_time">
                                </div>
                                <div style="width:694px;" ng-if="value.type == 'remark' && value.default_value">
                                    <span ng-bind-html="value.default_value"></span>
                                </div>
                                <div ng-if="!value.default_value && (value.type == 'remark' || vlaue.type == 'hide')">
                                    <ueditor ng-model="$parent.$parent.$parent.form_data1[value.type_id].option" uid="{{value.type_id}}_abc" style="width:694px"></ueditor>
                                </div>
                                <div ng-if="value.type == 'area'">
                                    {{form_data1[value.type_id].option}}
                                </div>
                                <div ng-if="value.type == 'radio'">
                                    <label data-toggle="radio1" class="radio-pretty inline {{v.option_name == form_data1[value.type_id].option?'checked':''}}" ng-repeat="v in form_data1[value.type_id].options">
                                        <input type="radio" name="radio1"
                                            ng-checked="{{v.option_name==form_data1[value.type_id].option}}"
                                            ng-model="form_data1[value.type_id].option"
                                            value="{{v.option_name}}"><span>{{v.option_name}}</span>
                                    </label>
                                </div>
                                <div ng-if="value.type == 'checkbox'">
                                    {{form_data1[value.type_id].option}}
                                    <br />
                                    <label ng-repeat="v in form_data1[value.type_id].options">
                                        <input class="" type="checkbox" name="checkbox_{{v.option_value}}"
                                            checklist-model="form_data1[value.type_id].option"
                                            checklist-value="v.option_value">{{v.option_name}}</label>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <button class="sui-btn btn-success" ng-click=" newExt(order); ">
                    保存
                </button>
            </form>
        </div>
    </div>
    <div class=" control-group ">
        <!-- ng-show=" order.shipping_corp && order.shipping_code " -->
        <label class=" control-label v-top "> </label>
        <div class=" controls ">
            <print tid=" {{ order.order_id }} "></print>
        </div>
    </div>
    <div class=" control-group " ng-show=" order.items[0].act_json.confession_detail_id ">
        <label class=" control-label v-top "> {{ "表白文案 " | translate }}：</label>
        <div class=" controls ">
            <span ng-repeat=" (key, value) in order.items ">
                <confession-detail-info ng-model=" value.act_json.confession_detail_id "></confession-detail-info>
            </span>
        </div>
    </div>
    <div class=" control-group " ng-show=" industryCode=='27' || industryCode=='28' ">
        <label class=" control-label v-top ">
            {{ "海关推送详情 " | translate }}：</label>
        <div class="controls" style=" width: 300px ">
            <button class="sui-btn btn-primary" ng-click="ordergetone(order.order_id,0)">刷新</button>
            <table class="sui-table table-bordered " style=" margin-bottom: 5px; ">
                <thead>
                    <tr>
                        <th>类型</th>
                        <th>状态</th>
                        <th style="width:500px">消息</th>
                        <th>时间</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat=" (key,value) in customs_notifys ">
                        <td>{{value.type}}</td>
                        <td>{{value.state }}</td>
                        <td>
                            <textarea rows=" 6 " ng-model=" value.msg " class=" input-xlarge "></textarea>
                        </td>
                        <td nowrap>{{ value.time }}</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <!-- <div class=" control-group ">
        <label class=" control-label v-top "> </label>
        <div class=" controls ">
            <a href=" #/classes/add?order_id={{ list.order_id }} " class=" sui-btn btn-success ">生成课程</a>
        </div>
    </div> -->

    <!-- <div class=" control-group " >
        <label class=" control-label v-top "> </label>
        <div class=" controls ">
            <print-xiaopiao tid=" {{order.order_id}} "></print-xiaopiao>
        </div>
    </div> -->
</div>